using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using EventHandler.Libraries.Business.Event;
using EventHandler.UI.Models;

namespace EventHandler.UI.Controllers
{
    public class EventController : Controller
    {
        //
        // GET: /Event/

        public JsonResult Create(String id)
        {
            CreateEventItem eventItem = new CreateEventItem();

            eventItem.OwnerId = 1;
            eventItem.Title = id;

            DatabaseHelper dbHelper = new DatabaseHelper();
            EventItemHelper helper = new EventItemHelper(dbHelper);

            int eventId = helper.CreateEvent(eventItem);

            return Json(new {Message = id, Success = true});
            
        }

    }
}
